<!DOCTYPE html "http://www.thymeleaf.org/dtd/xhtml1-strict-thymeleaf-spring4-4.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:th="http://www.thymeleaf.org">


<meta charset="utf-8">
<head th:include="include :: header"></head>
<body class="gray-bg">
<div class="wrapper wrapper-content ">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm">
                        <input type="hidden" id="returnOrderId" name="returnOrderId" th:value="${orderReturnInfo.returnOrderId}">
                        <div class="form-group">
                            <label class="col-sm-2 control-label">订单编号：</label>
                            <div class="col-sm-10">
                                <input id="orderId"  th:value="${orderReturnInfo.orderId}"
                                       class="form-control" type="text"  readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">订单总金额：</label>
                            <div class="col-sm-4">
                                <input type="text" id="totalAmt" name="totalAmt" th:value="${orderReturnInfo.totalAmt}"
                                       data-placeholder="订单总金额" class="form-control" readonly="readonly">
                            </div>
                            <label id="lb_rate" class="col-sm-2 control-label" >支付金额：</label>
                            <div id="div_rate"  class="col-sm-4">
                                <input type="text" id="payAmt" name="payAmt" th:value="${orderReturnInfo.payAmt}"
                                       data-placeholder="支付金额" class="form-control"  readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">物流快递费用：</label>
                            <div class="col-sm-10">
                                <input id="shipFee"  th:value="${orderReturnInfo.shipFee}"
                                       class="form-control" type="text" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">退款申请时间：</label>
                            <div class="col-sm-10">
                                <input id="reqReturnTime"  th:value="${#dates.format(orderReturnInfo.reqReturnTime,'yyyy-MM-dd HH:mm:ss')}"
                                       class="form-control" type="text" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group" th:if="${orderReturnInfo.finishReturnTime} != null">
                            <label class="col-sm-2 control-label">退款完成时间：</label>
                            <div class="col-sm-10">
                                <input id="finishReturnTime"  th:value="${#dates.format(orderReturnInfo.finishReturnTime,'yyyy-MM-dd HH:mm:ss')}"
                                       class="form-control" type="text" readonly="readonly">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">退款总金额：</label>
                            <div class="col-sm-10">
                                <input id="returnTotalAmt"  name="returnTotalAmt" th:value="${orderReturnInfo.returnTotalAmt}"
                                       class="form-control" type="text" readonly="readonly" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">退款状态：</label>
                            <div class="col-sm-10">
                                <select id="returnOrderStatus" name="returnOrderStatus" th:field="${orderReturnInfo.returnOrderStatus}"
                                        data-placeholder="退款状态" class="form-control chosen-select" disabled>
                                    <option value="0">退款中</option>
                                    <option value="1">退款审核通过</option>
                                    <option value="2">退款失败</option>
                                    <option value="3">用户撤销</option>
                                    <option value="4">用户已退货</option>
                                    <option value="5">退款完成</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-2 control-label">换货/退款理由类型：</label>
                            <div class="col-sm-10">
                                <select id="returnReasonType" name="returnReasonType" th:field="${orderReturnInfo.returnReasonType}"
                                        data-placeholder="换货/退款理由类型" class="form-control chosen-select" disabled>
                                    <option value="1">7天/30天无理由退货</option>
                                    <option value="2">商品质量问题</option>
                                    <option value="0">其它</option>
                                    <option value="3">误购</option>
                                    <option value="4">地址错误</option>
                                    <option value="5">不想要了</option>
                                    <option value="6">价格太贵</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-2 control-label">退款理由：</label>
                            <div class="col-sm-10">
                                <p th:utext="${orderReturnInfo.reqReturnReason}" class="form-control"></p>
                            </div>
                        </div>
                        <div class="form-group" th:if="${orderReturnInfo.rejectReason} != null">
                            <label class="col-sm-2 control-label">失败原因：</label>
                            <div class="col-sm-10">
                                <input id="rejectReason" name="rejectReason" class="form-control" type="text"  th:value="${orderReturnInfo.rejectReason}" readonly="readonly">
                            </div>
                        </div>


                        <div class="form-group" th:if="${orderReturnInfo.returnShipTraceNo  != null}">
                            <label class="col-sm-2 control-label">退回快递单号：</label>
                            <div class="col-sm-10">
                                <input id="returnShipTraceNo" name="returnShipTraceNo" class="form-control" type="text"  th:value="${orderReturnInfo.returnShipTraceNo}" readonly="readonly">
                            </div>
                        </div>

                        <div class="form-group" th:if="${orderReturnInfo.shipTraceNo != null} ">
                            <label class="col-sm-2 control-label">卖家寄回快递单号：</label>
                            <div class="col-sm-10">
                                <input id="shipTraceNo" name="shipTraceNo" class="form-control" type="text"  th:value="${orderReturnInfo.shipTraceNo}" readonly="readonly">
                            </div>
                        </div>

                        <table id="exampleTable" data-mobile-responsive="true">
                        </table>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<div th:include="include::footer"></div>
<script type="text/javascript">

    var prefix = "/app/orderReturn";
    $(function () {
        load();
    });
    function load() {
        $('#exampleTable')
            .bootstrapTable(
                {
                    method: 'get', // 服务器数据的请求方式 get or post
                    url: prefix + "/orderItemlist", // 服务器数据的加载地址
                    //showRefresh: true,
                    //	showToggle : true,
                    //	showColumns : true,
                    iconSize: 'outline',
                    toolbar: '#exampleToolbar',
                    striped: true, // 设置为true会有隔行变色效果
                    dataType: "json", // 服务器返回的数据类型
                    pagination: false, // 设置为true会在底部显示分页条
                    // queryParamsType : "limit",
                    // //设置为limit则会发送符合RESTFull格式的参数
                    singleSelect: false, // 设置为true将禁止多选
                    // contentType : "application/x-www-form-urlencoded",
                    // //发送到服务器的数据编码类型
                    pageSize: 10, // 如果设置了分页，每页数据条数
                    pageNumber: 1, // 如果设置了分布，首页页码
                    //search : true, // 是否显示搜索框
                    showColumns: false, // 是否显示内容下拉框（选择显示的列）
                    sidePagination: "server", // 设置在哪里进行分页，可选值为"client" 或者 "server"
                    queryParams: function () {
                        return {
                            //说明：传入后台的参数包括offset开始索引，limit步长，sort排序列，order：desc或者,以及所有列的键值对
                            limit: this.limit,
                            offset: this.offset,
                            returnOrderId:$('#returnOrderId').val()
                        };
                    },
                    // //请求服务器数据时，你可以通过重写参数的方式添加一些额外的参数，例如 toolbar 中的参数 如果
                    // queryParamsType = 'limit' ,返回参数必须包含
                    // limit, offset, search, sort, order 否则, 需要包含:
                    // pageSize, pageNumber, searchText, sortName,
                    // sortOrder.
                    // 返回false将会终止请求
                    columns: [
                        {
                            field: 'id',
                            title: '编号'
                        },
                        {
                            field: 'returnOrderId',
                            title: '退款订单编号'
                        },
                        {
                            field:'productName',
                            title:'商品名称'
                        },
                        {
                            field:'colorName',
                            title:'颜色名称'
                        },
                        {
                            field:'specsName',
                            title:'规格名称'
                        },
                        {
                            field:'returnNums',
                            title:'退款数量'
                        },
                        {
                            field:'price',
                            title:'商品单价'
                        },
                        {
                            field:'totalPrice',
                            title:'总价'
                        },
                        {
                            field:'shipFee',
                            title:'快递费用'
                        },
                        {
                            field:'totalAmt',
                            title:'订单金额'
                        },
                        {
                            field:'memberName',
                            title:'下单人姓名'
                        }]
                });
    }
</script>
</body>
</html>